package thread;

import javax.enterprise.inject.New;

/**
*@author:gang
*@version:
**/
public class main {
	public static void main(String[] args) throws InterruptedException{
		
		//001
//		MyRunable myRunable = new MyRunable();
//		Thread runableThread = new Thread(myRunable);
//		Mythread mythread = new Mythread();
//		runableThread.start();
//		mythread.start();
		//////////////////////////////////////////////////////
		//002
//		Mythread mythread01 =new Mythread();
//		Mythread mythread02 =new Mythread();
//		Mythread mythread03 =new Mythread();
//		mythread01.start();
//		mythread02.start();
//		mythread03.start();
		ServiceClass serviceClass = new ServiceClass();
		Object lockObject = new Object();
		Mythread mythread =new Mythread(lockObject);
		mythread.setName("001");
		MyThread02 mythread2 =new MyThread02(lockObject);
		mythread2.setName("002");
		Thread mythread01 =new Thread(mythread);
		mythread01.start();
		Thread.sleep(50);
		Thread mythread02 =new Thread(mythread2);
		
		mythread02.start();
//		try {
//			Thread.sleep(500);
//		} catch (InterruptedException e) {
//			// TODO Auto-generated catch block
//			e.printStackTrace();
//		}
//		mythread02.start();

	}
}
